home *** CD-ROM | disk | FTP | other *** search
/ Stone Design / Stone Design.iso / Stone_Friends / Wave / WavesWorld / Source / IBPalettes / WWTCLKit / WWMovieProcViewIBInspector.m < prev    next >
Encoding:
Text File  |  1995-03-22  |  2.1 KB  |  80 lines

  1.  
  2. #import "WWMovieProcView.h"
  3. #import "WWMovieProcViewIBInspector.h"
  4.  
  5. @implementation WWMovieProcViewIBInspector
  6.  
  7. - init 
  8. {
  9.    char buf[MAXPATHLEN + 1];
  10.    id bundle = [NXBundle bundleForClass:[WWMovieProcView class]];
  11.     
  12.  
  13.    [super init];
  14.  
  15.    tclProcBodySize = 256;
  16.    tclProcBody = (char *)NXZoneCalloc([self zone], tclProcBodySize, sizeof(char));
  17.  
  18.    [bundle getPath:buf forResource:[[self class] name] ofType:"nib"];
  19.    [NXApp loadNibFile:buf owner:self withNames:NO fromZone:[self zone]];
  20.  
  21.    // since the textView was "hidden" inside the ScrollView, we couldn't do this in IB, so...
  22.    [tclProcBodyText setDelegate:self];
  23.  
  24.    [self revert:self];
  25.  
  26.    return self;
  27. }
  28. //
  29. - free
  30. {
  31.   return [super free];
  32. }
  33. //
  34. - revert:sender 
  35. {
  36.   [tclProcName setStringValue:[object tclProcName]];
  37.   [tclProcType setStringValue:[object tclProcType]]; 
  38.   [tclProcArgs setStringValue:[object tclProcArgs]]; 
  39.   [tclProcBodyText setText:[object tclProcBody]];
  40.   [restrictProcNameSwitch setIntValue:[object restrictDropToSameName]];
  41.   [restrictProcTypeSwitch setIntValue:[object restrictDropToSameType]];
  42.   [sourceSwitch setIntValue:[object actAsSource]];
  43.   [sinkSwitch setIntValue:[object actAsSink]];
  44.   return [super revert:sender];
  45. }
  46. //
  47. - ok:sender
  48. {
  49.   int   cnt;
  50.  
  51.  
  52.   cnt = [tclProcBodyText textLength];
  53.   while (cnt >= tclProcBodySize)
  54.   {  tclProcBodySize *= 2;
  55.      tclProcBody = (char *)NXZoneRealloc([self zone], tclProcBody, tclProcBodySize);
  56.   }
  57.   *tclProcBody = '\0';
  58.   [tclProcBodyText getSubstring:tclProcBody start:0 length:(cnt + 1)];
  59.   [object setTclProcBody:tclProcBody];
  60.  
  61.   [object setTclProcName:[tclProcName stringValue]];
  62.   [object setTclProcType:[tclProcType stringValue]];
  63.   [object setTclProcArgs:[tclProcArgs stringValue]];
  64.   [object setRestrictDropToSameName:(BOOL)[restrictProcNameSwitch intValue]];
  65.   [object setRestrictDropToSameType:(BOOL)[restrictProcTypeSwitch intValue]];
  66.   [object setActAsSource:(BOOL)[sourceSwitch intValue]];
  67.   [object setActAsSink:(BOOL)[sinkSwitch intValue]];
  68.  
  69.   return [super ok:sender]; 
  70. }
  71. //
  72. - (BOOL)wantsButtons    { return YES; }
  73.  
  74. // text delegate methods
  75. - textDidChange:sender {  return [self touch:sender]; }
  76.  
  77.  
  78.  
  79. @end
  80.